﻿@using DTcms.Model;
@using DTcms.Common;
@{
    Layout = "~/Areas/admin/Views/Shared/_LayoutEdit.cshtml";
    ViewBag.Title = "site_edit";
    DTcms.Model.sites m = ViewData["model"] as sites;
    List<SelectListItem> selectListItems = ViewData["selectListItems"] as List<SelectListItem>;
    string action = ViewBag as string;
}

@section HeaderContent{
   <script>
      $(function () {
         //初始化表单验证
         $("#form1").initValidform();
         //初始化上传控件
         $(".upload-img").InitUploader({ sendurl: "/tools/upload_ajax.ashx", swf: "/scripts/webuploader/uploader.swf" });
      });
   </script>
}

<form id="form1" method="post" action="SubmitSave?action=@ViewBag.Action&id=@ViewBag.Id">
<!--导航栏-->
<div class="location">
  <a href="../site_list/index" class="back"><i class="iconfont icon-up"></i><span>返回列表页</span></a>
  <a href="../../center/index"><i class="iconfont icon-home"></i><span>首页</span></a>
  <i class="arrow iconfont icon-arrow-right"></i>
  <a href="../site_list/index"><span>站点管理</span></a>
  <i class="arrow iconfont icon-arrow-right"></i>
  <span>编辑站点</span>
  <div class="clipboard">
     <span><label id="clipMess"></label></span>
     <a href="javascript:;" class="copy" onclick="copy();"><i class="iconfont icon-copy"></i><span>复制</span></a>
     <a href="javascript:;" class="paste disable" onclick="paste();"><i class="iconfont icon-log"></i><span>粘贴</span></a>
  </div>
</div>
<div class="line10"></div>
<!--/导航栏-->

<!--内容-->
<div id="floatHead" class="content-tab-wrap">
  <div class="content-tab">
    <div class="content-tab-ul-wrap">
      <ul>
        <li><a class="selected" href="javascript:;">站点设置</a></li>
        <li><a href="javascript:;">网站信息</a></li>
      </ul>
    </div>
  </div>
</div>

<div class="tab-content">
  <dl>
    <dt>站点类型</dt>
    <dd>
      <div class="rule-multi-radio">
          <asp:RadioButtonList ID="rblSiteType" runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow">
              <asp:ListItem Value="1" Selected="True">电脑站</asp:ListItem>
              <asp:ListItem Value="2">移动站</asp:ListItem>
              <asp:ListItem Value="3">微信站</asp:ListItem>
          </asp:RadioButtonList>
         <span>
            @Html.RadioButton("rblSiteType", "1", m.site_type == 1, new { id="rblSiteType_1"})<label for="rblSiteType_1">电脑站</label>
            @Html.RadioButton("rblSiteType", "2", m.site_type == 2, new { id="rblSiteType_2"})<label for="rblSiteType_1">移动站</label>
            @Html.RadioButton("rblSiteType", "3", m.site_type == 3, new { id="rblSiteType_3"})<label for="rblSiteType_1">微信站</label>
         </span>
      </div>
    </dd>
  </dl>
   <dl>
    <dt>数据来源</dt>
    <dd>
      <div class="rule-single-select">
         <span>
            @Html.DropDownList("ddlParentId", new SelectList(selectListItems, "Value", "Text", m.parent_id), new { datatype="*", sucmsg=" "})
         </span>
       </div>
       <span class="Validform_checktip">*选择站点后，共享该站点的数据。</span>
    </dd>
  </dl>
  <dl>
    <dt>站点名称</dt>
    <dd>
      @Html.TextBox("txtTitle", m.title, new { @class = "input normal", datatype = "*2-100", sucmsg = " " })
      <span class="Validform_checktip">*标题备注，允许中文。</span>
    </dd>
  </dl>
  <dl>
    <dt>生成目录名</dt>
    <dd>
       @if (ViewBag.Action.ToString() == "Add") {
          @Html.TextBox("txtBuildPath", m.build_path, new { @class = "input normal", datatype = @"/^[a-zA-Z0-9\-\_]{2,50}$/", errormsg = "请填写正确的名称！", sucmsg = " ", ajaxurl = "/tools/admin_ajax.ashx?action=site_path_validate" })
       }
       else {
          @Html.TextBox("txtBuildPath", m.build_path, new { @class = "input normal", datatype = @"/^[a-zA-Z0-9\-\_]{2,50}$/", errormsg = "请填写正确的名称！", sucmsg = " ", ajaxurl = "/tools/admin_ajax.ashx?action=site_path_validate&old_build_path=" + Utils.UrlEncode(m.build_path) })
       }
       <span class="Validform_checktip">*频道分类目录，只允许使用英文、下划线。</span>
    </dd>
  </dl>
  <dl>
    <dt>绑定域名</dt>
    <dd>
      @Html.TextBox("txtDomain", m.domain, new{ @class="input normal", datatype=@"/^\s*$|^([a-zA-Z0-9\-\u4e00-\u9fa5]+\.)+[a-zA-Z\u4e00-\u9fa5]+$/", errormsg="请输入正确的域名！", sucmsg=" "})
       <span class="Validform_checktip">*不能和主域名相同，域名去除“http://”部分。</span>
    </dd>
  </dl>
  <dl>
    <dt>是否启用</dt>
    <dd>
      <div class="rule-single-checkbox">
         @Html.CheckBox("cbIsLock", m.is_lock == 0)
      </div>
      <span class="Validform_checktip">*不启用则不加载该站点</span>
    </dd>
  </dl>
  <dl>
    <dt>是否默认</dt>
    <dd>
      <div class="rule-single-checkbox">
         @Html.CheckBox("cbIsDefault", m.is_default == 1)
      </div>
      <span class="Validform_checktip">*只允许一个默认站点，默认则不能绑定域名。</span>
    </dd>
  </dl>
  <dl>
    <dt>排序数字</dt>
    <dd>
      @Html.TextBox("txtSortId", m.sort_id, new{ @class="input small", datatype="n", sucmsg=" "})
      <span class="Validform_checktip">*数字，越小越向前</span>
    </dd>
  </dl>
</div>

<div class="tab-content" id="siteInfo" style="display:none;">
  <dl>
    <dt>网站名称</dt>
    <dd>
      @Html.TextBox("txtName", m.name, new{ @class="input normal", datatype="*2-255", sucmsg=" "})
      <span class="Validform_checktip">*任意字符，控制在255个字符内</span>
    </dd>
  </dl>
  <dl>
    <dt>网站LOGO</dt>
    <dd>
      @Html.TextBox("txtLogo", m.logo, new{ @class="input normal upload-path"})
      <div class="upload-box upload-img"></div>
    </dd>
  </dl>
  <dl>
    <dt>公司名称</dt>
    <dd>
      @Html.TextBox("txtCompany", m.company, new { @class="input normal"})
    </dd>
  </dl>
  <dl>
    <dt>通讯地址</dt>
    <dd>
      @Html.TextBox("txtAddress", m.address, new {@class="input normal"})
    </dd>
  </dl>
  <dl>
    <dt>联系电话</dt>
    <dd>
      @Html.TextBox("txtTel", m.tel, new {@class="input normal"})
      <span class="Validform_checktip">*非必填，区号+电话号码</span>
    </dd>
  </dl>
  <dl>
    <dt>传真号码</dt>
    <dd>
      @Html.TextBox("txtFax", m.fax, new {@class="input normal"})
      <span class="Validform_checktip">*非必填，区号+传真号码</span>
    </dd>
  </dl>
  <dl>
    <dt>电子邮箱</dt>
    <dd>
      @Html.TextBox("txtEmail", m.email, new {@class="input normal"})
    </dd>
  </dl>
  <dl>
    <dt>网站备案号</dt>
    <dd>
      @Html.TextBox("txtCrod", m.crod, new {@class="input normal"})
    </dd>
  </dl>
  <dl>
    <dt>首页标题(SEO)</dt>
    <dd>
      @Html.TextBox("txtSeoTitle", m.seo_title, new {@class="input normal"})
      <span class="Validform_checktip">*自定义的首页标题</span>
    </dd>
  </dl>
  <dl>
    <dt>页面关健词(SEO)</dt>
    <dd>
      @Html.TextBox("txtSeoKeyword", m.seo_keyword, new {@class="input normal"})
      <span class="Validform_checktip">页面关键词(keyword)</span>
    </dd>
  </dl>
  <dl>
    <dt>页面描述(SEO)</dt>
    <dd>
      @Html.TextBox("txtSeoDescription", m.seo_description, new {@class="input normal"})
      <span class="Validform_checktip">页面描述(description)</span>
    </dd>
  </dl>
  <dl>
    <dt>底部版权信息</dt>
    <dd>
      @Html.TextArea("txtCopyright", m.copyright, new {@class="input"})
      <span class="Validform_checktip">支持HTML</span>
    </dd>
  </dl>
</div>
<!--/内容-->

<!--工具栏-->
<div class="page-footer">
  <div class="btn-wrap">
    <input type="submit" id="btnSubmit" class="btn" value="提交保存" />
    <input name="btnReturn" type="button" value="返回上一页" class="btn yellow" onclick="javascript: history.back(-1);" />
  </div>
</div>
<!--/工具栏-->
</form>